<!DOCTYPE html>
<html>
<head th:include="common/header_css::header('霸王餐小程序后台管理-充值返现|积分','%')"></head>
<body class="gray-bg">
<div class="wrapper wrapper-content animated fadeInRight">
    <div class="ibox float-e-margins">
        <div th:replace="common/toolbar::toolbar('充值返现|积分管理')"></div>
        <div th:replace="common/search::search('%add')"></div>
    </div>
</div>

<!--添加Czfan模态框-->
<div id="modal-add-form" class="modal fade" aria-hidden="true">
    <div class="modal-dialog" style="width: 800px;">
        <div class="modal-content">
            <div class="modal-body">
                <div class="row">
                    <h3 class="m-t-none m-b">会员充值返现|积分添加</h3>
                    <div class="col-sm-12">
                        <div class="ibox float-e-margins">
                            <div class="ibox-content">
                                <form id="aform" method="post" class="form-horizontal" action="add"
                                      onsubmit="return checkAdd()">
                                    <div class="row">
                                        <div class="col-md-6">
                                            <div class="form-group">
                                                <label class="col-sm-4 control-label">充值返类型</label>
                                                <div class="col-sm-8">
                                                    <select class="form-control" name="ftype"
                                                            onchange="ftypeChange(this.value,'add')">
                                                        <option value="1">送积分</option>
                                                        <option value="2">送现金</option>
                                                        <option value="3">送优惠券</option>
                                                        <option value="4">送虚拟币</option>
                                                        <option value="5">送商品</option>
                                                        <option value="6">混合型</option>
                                                    </select>
                                                </div>
                                            </div>
                                        </div>
                                        <div class="col-md-6">
                                            <div class="form-group">
                                                <label class="col-sm-4 control-label">几级会员</label>
                                                <div class="col-sm-8">
                                                    <select class="form-control select2" name="level" id="level2"  onchange="levelChange(this.value,'add')">
                                                        <option th:each="c:${huiyuans}" th:value="${c.level}" th:text="${c.name}"></option>
                                                    </select>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                    <div class="row">
                                        <div class="col-md-6">
                                            <div class="form-group">
                                                <label class="col-sm-4 control-label">冲多少</label>
                                                <div class="col-sm-8">
                                                    <select class="form-control select2" name="chong" id="chong2" readonly="readonly">
                                                        <option th:each="c:${huiyuans}" th:value="${c.huifei}" th:text="${c.huifei}"></option>
                                                    </select>
                                                </div>
                                            </div>
                                        </div>
                                        <div class="col-md-6">
                                            <div class="form-group">
                                                <label class="col-sm-4 control-label">会员有效期</label>
                                                <div class="col-sm-8">
                                                    <input class="form-control" name="expire" type="number"/>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                    <div class="row">
                                        <div class="col-md-6">
                                            <div class="form-group" id="afancash">
                                                <label class="col-sm-4 control-label">返现金</label>
                                                <div class="col-sm-8">
                                                    <input class="form-control" name="fancash" type="number"/>
                                                </div>
                                            </div>
                                        </div>
                                        <div class="col-md-6">
                                            <div class="form-group" id="afanbi">
                                                <label class="col-sm-4 control-label">返币</label>
                                                <div class="col-sm-8">
                                                    <input class="form-control" name="fanbi" type="number"/>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                    <div class="row" id="afanquan">
                                        <div class="col-md-6">
                                            <div class="form-group">
                                                <label class="col-sm-4 control-label">返券</label>
                                                <div class="col-sm-8">
                                                    <select class="form-control select2" name="fanquan" id="fanquan2">
                                                        <option th:each="c:${couponTpls}" th:value="${c.id}"
                                                                th:text="${c.name}"></option>
                                                    </select>
                                                </div>
                                            </div>
                                        </div>
                                        <div class="col-md-6">
                                            <div class="form-group">
                                                <label class="col-sm-4 control-label">返券数</label>
                                                <div class="col-sm-8">
                                                    <input class="form-control" name="quanshu" type="number" value="0"/>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                    <div class="row" id="afangoods">
                                        <div class="col-md-6">
                                            <div class="form-group">
                                                <label class="col-sm-4 control-label">返商品</label>
                                                <div class="col-sm-8">
                                                    <select class="form-control select2" name="fangoods" id="fangoods2">
                                                        <option value="">如返商品请选择</option>
                                                        <option th:each="c:${goods}" th:value="${c.id}"
                                                                th:text="${c.name}"></option>
                                                    </select>
                                                </div>
                                            </div>
                                        </div>
                                        <div class="col-md-6">
                                            <div class="form-group">
                                                <label class="col-sm-4 control-label">返商品数</label>
                                                <div class="col-sm-8">
                                                    <input class="form-control" name="goodsshu" type="number" value="0"/>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                    <div class="row">
                                        <div class="col-md-6">
                                            <div class="form-group" id="afanjifen">
                                                <label class="col-sm-4 control-label">返积分</label>
                                                <div class="col-sm-8">
                                                    <input class="form-control" name="fanjifen" type="number"/>
                                                </div>
                                            </div>
                                        </div>
                                        <div class="col-md-6">
                                            <div class="form-group">
                                                <!--<label class="col-sm-4 control-label">会员名</label>-->
                                                <!--<div class="col-sm-8">-->
                                                <!--<input class="form-control" name="hyname"-->
                                                <!--id="hyname2" type="hidden"  maxlength="50"/>-->
                                                <!--</div>-->
                                            </div>
                                        </div>
                                    </div>
                                    <div class="form-group">
                                        <div class="col-sm-4 col-sm-offset-2">
                                            <button class="btn btn-primary" type="submit">保存内容</button>
                                            <button data-toggle="modal" type="button" class="btn btn-white"
                                                    href="#modal-add-form">取消
                                            </button>
                                        </div>
                                    </div>
                                    <input id="hidhyname" name="hyname" type="hidden" value=""/>
                                </form>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>

<!--修改Czfan模态框-->
<div id="modal-form" class="modal fade" aria-hidden="true">
    <div class="modal-dialog" style="width: 800px;">
        <div class="modal-content">
            <div class="modal-body">
                <div class="row">
                    <h3 class="m-t-none m-b">充值返现|积分修改</h3>
                    <div class="col-sm-12">
                        <div class="ibox float-e-margins">
                            <div class="ibox-content">
                                <form id="mform" method="post" class="form-horizontal" action="modify"
                                      onsubmit="return checkModify()">
                                    <div class="row">
                                        <div class="col-md-6">
                                            <div class="form-group">
                                                <label class="col-sm-4 control-label">充值返类型</label>
                                                <div class="col-sm-8">
                                                    <select class="form-control" name="ftype" id="ftype"
                                                            onchange="ftypeChange(this.value,'modify')">
                                                        <option value="1">送积分</option>
                                                        <option value="2">送现金</option>
                                                        <option value="3">送优惠券</option>
                                                        <option value="4">送虚拟币</option>
                                                        <option value="5">送商品</option>
                                                        <option value="6">混合型</option>
                                                    </select>
                                                </div>
                                            </div>
                                        </div>
                                        <div class="col-md-6">
                                            <div class="form-group">
                                                <label class="col-sm-4 control-label">几级会员</label>
                                                <div class="col-sm-8">
                                                    <select class="form-control select2" name="level" id="level"
                                                            disabled>
                                                        <option th:each="c:${huiyuans}" th:value="${c.level}"
                                                                th:text="${c.name}"></option>
                                                    </select>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                    <div class="row">
                                        <div class="col-md-6">
                                            <div class="form-group">
                                                <label class="col-sm-4 control-label">冲多少</label>
                                                <div class="col-sm-8">
                                                    <select class="form-control select2" id="chong" name="chong" readonly="readonly">
                                                        <option th:each="c:${huiyuans}" th:value="${c.huifei}" th:text="${c.huifei}"></option>
                                                    </select>
                                                </div>
                                            </div>
                                        </div>
                                        <div class="col-md-6">
                                            <div class="form-group">
                                                <label class="col-sm-4 control-label">会员有效期</label>
                                                <div class="col-sm-8">
                                                    <input class="form-control" id="expire" name="expire" type="number"/>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                    <div class="row">
                                        <div class="col-md-6">
                                            <div class="form-group" id="mfancash">
                                                <label class="col-sm-4 control-label">返现金</label>
                                                <div class="col-sm-8">
                                                    <input class="form-control" id="fancash" name="fancash" type="number"/>
                                                </div>
                                            </div>
                                        </div>
                                        <div class="col-md-6">
                                            <div class="form-group" id="mfanbi">
                                                <label class="col-sm-4 control-label">返币</label>
                                                <div class="col-sm-8">
                                                    <input class="form-control" id="fanbi" name="fanbi" type="number"/>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                    <div class="row" id="mfanquan">
                                        <div class="col-md-6">
                                            <div class="form-group">
                                                <label class="col-sm-4 control-label">返券</label>
                                                <div class="col-sm-8">
                                                    <select onchange="quanChange(this.value)"
                                                            class="form-control select2" name="fanquan" id="fanquan">
                                                        <option th:each="c:${couponTpls}" th:value="${c.id}"
                                                                th:text="${c.name}"></option>
                                                    </select>
                                                </div>
                                            </div>
                                        </div>
                                        <div class="col-md-6">
                                            <div class="form-group">
                                                <label class="col-sm-4 control-label">返券数</label>
                                                <div class="col-sm-8">
                                                    <input class="form-control" id="quanshu" name="quanshu" type="number" value="0"/>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                    <div class="row" id="mfangoods">
                                        <div class="col-md-6">
                                            <div class="form-group">
                                                <label class="col-sm-4 control-label">返商品</label>
                                                <div class="col-sm-8">
                                                    <select class="form-control select2" name="fangoods" id="fangoods">
                                                        <option value="">如返商品请选择</option>
                                                        <option th:each="c:${goods}" th:value="${c.id}"
                                                                th:text="${c.name}"></option>
                                                    </select>
                                                </div>
                                            </div>
                                        </div>
                                        <div class="col-md-6">
                                            <div class="form-group">
                                                <label class="col-sm-4 control-label">返商品数</label>
                                                <div class="col-sm-8">
                                                    <input class="form-control" id="goodsshu" name="goodsshu" type="number" value="0"/>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                    <div class="row">
                                        <div class="col-md-6">
                                            <div class="form-group" id="mfanjifen">
                                                <label class="col-sm-4 control-label">返积分</label>
                                                <div class="col-sm-8">
                                                    <input class="form-control" id="fanjifen" name="fanjifen"
                                                           type="number"/>
                                                </div>
                                            </div>
                                        </div>
                                        <div class="col-md-6">
                                            <!--<div class="form-group">-->
                                            <!--<label class="col-sm-4 control-label">会员名</label>-->
                                            <!--<div class="col-sm-8">-->
                                            <!--<input class="form-control" id="hyname" name="hyname"-->
                                            <!--type="text" maxlength="50"/>-->
                                            <!--</div>-->
                                            <!--</div>-->
                                        </div>
                                    </div>
                                    <div class="form-group">
                                        <div class="col-sm-4 col-sm-offset-2">
                                            <button class="btn btn-primary" type="submit">保存内容</button>
                                            <button data-toggle="modal" type="button" class="btn btn-white"
                                                    href="#modal-form">取消
                                            </button>
                                        </div>
                                    </div>
                                    <input id="id" name="id" type="hidden" value=""/>
                                    <input id="hidhyname2" name="hyname" type="hidden" value=""/>
                                </form>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>

<input id="hidfxlevel" type="hidden" th:value="${hylevel}"/>

<div th:include="common/footer_js::footer"></div>
<script src="/js/admin/czfan.js"></script>
</body>
</html>
